import { stringify } from 'qs';
import request from '@/utils/request';
import {formDataCode} from '@/utils/utils';

// 获取同城配送待配送订单列表
export async function GetOrderList(params) {
  return request(`/${window.storeId}/CityOrder/GetOrderList?${stringify(params)}`);
}

// 订单批量发货
export async function DeliveryBatch(params) {
  return request(`/${window.storeId}/CityOrder/DeliveryBatch`, {
    method: 'POST',
    body: {
      ...params
    }
  });
}

// 获取打印配置
export async function GetPrintItemConfig(params) {
  return request(`/${window.storeId}/CityOrder/GetPrintItemConfig?${stringify(params)}`);
}
// 保存打印配置
export async function SaveLPrintConfig(params) {
  return request(`/${window.storeId}/CityOrder/SaveLPrintConfig`, {
    method: 'POST',
    body: {
      ...params
    }
  });
}

// 获取配送员列表
export async function GetDeliveryManList(params) {
  return request(`/${window.storeId}/CityOrder/GetDeliveryManList`);
}
// 获取配送员分页列表
export async function GetDeliveryManPageList(params) {
  return request(`/${window.storeId}/CityOrder/GetDeliveryManPageList?${stringify(params)}`);
}

// 删除配送员（可批量）
export async function DeleteMan(params) {
  return request(`/${window.storeId}/CityOrder/DeleteMan`, {
    method: 'POST',
    body: `"${params}"`.toString()
  });
}

// 新增配送员
export async function AddMan(params) {
  return request(`/${window.storeId}/CityOrder/AddMan`, {
    method: 'POST',
    body: {
      ...params
    }
  });
}
